package com.bc004346.travelus.model.domain;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.List;

/**
 * Created by Renats on 7/8/2014.
 * Encapsulates a list of passengers and implements serializable
 */
public class PassengerList implements Serializable {

    //<editor-fold desc="Members">
    private static final Long serialVersionUID = 4436222416000000004L;
    private List<Passenger> mPassengers;
    //</editor-fold>

    //<editor-fold desc="Constructor">
    public PassengerList(List<Passenger> passengers) {
        mPassengers = passengers;
    }
    //</editor-fold>

    //<editor-fold desc="Properties">
    public List<Passenger> getPassengers() {
        return mPassengers;
    }
    //</editor-fold>

    //<editor-fold desc="Serializable members">

    private void readObject(
            ObjectInputStream aInputStream
    ) throws ClassNotFoundException, IOException {
        //always perform the default de-serialization first
        aInputStream.defaultReadObject();
    }

    private void writeObject(
            ObjectOutputStream aOutputStream
    ) throws IOException {
        //perform the default serialization for all non-transient, non-static fields
        aOutputStream.defaultWriteObject();
    }

    //</editor-fold>
}
